﻿<Window x:Class="Fidely.Demo.DBViewer.Views.DatabaseWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:exttoolkit="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit.Extended"
        xmlns:fidely.controls="clr-namespace:Fidely.Framework.Integration.WPF;assembly=Fidely.Framework.Integration.WPF"
        Title="MainWindow"
        MinHeight="600" MinWidth="800">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="3*"/>
        </Grid.ColumnDefinitions>
        <ListBox Grid.Column="0" ItemsSource="{Binding Tables}" IsSynchronizedWithCurrentItem="True" BorderThickness="0" SelectionChanged="OnTableSelected">
            <!--<ListBox.GroupStyle>
                <GroupStyle>
                    <GroupStyle.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Name}" FontWeight="Bold" FontStyle="Italic" Margin="2"/>
                        </DataTemplate>
                    </GroupStyle.HeaderTemplate>
                </GroupStyle>
            </ListBox.GroupStyle>-->
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <TextBlock Text="{Binding Name}" Margin="5"/>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <GridSplitter Grid.Column="1" ResizeBehavior="PreviousAndNext" ResizeDirection="Columns" Width="2"/>
        <DockPanel Grid.Column="2">
            <StackPanel DockPanel.Dock="Top">
                <StackPanel.Background>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                        <GradientStop Color="#FAFAFA" Offset="0.35"/>
                        <GradientStop Color="#F0F0F0" Offset="0.95"/>
                        <GradientStop Color="#FAFAFA" Offset="1"/>
                    </LinearGradientBrush>
                </StackPanel.Background>
                <Border Margin="3" Background="White" CornerRadius="5" BorderThickness="1" BorderBrush="LightGray">
                    <StackPanel>
                        <fidely.controls:AutocompleteExtender Extendee="{Binding ElementName=searchTextBox}" CompilerSetting="{Binding CompilerSetting}" SearchExecuted="Search">
                            <exttoolkit:WatermarkTextBox Name="searchTextBox" Watermark="Search Query" BorderThickness="0" Margin="2" HorizontalAlignment="Stretch"/>
                        </fidely.controls:AutocompleteExtender>
                    </StackPanel>
                </Border>
            </StackPanel>
            <DataGrid ItemsSource="{Binding DataSource}"/>
            <!--<ListBox Name="entriesListBox" ItemsSource="{Binding DataSource}" BorderThickness="0" SelectionMode="Single">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Width="{Binding ViewportWidth, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ScrollViewer}}">
                            <TextBlock Text="{Binding DatePublished}" FontSize="11" Margin="2,2,0,0"/>
                            <TextBlock FontWeight="Bold" Text="{Binding Title}" TextWrapping="Wrap" Margin="2,0,4,0"/>
                            <TextBlock Text="{Binding Author, StringFormat=Published by {0}}" FontSize="11" HorizontalAlignment="Right" Margin="0,0,4,2"/>
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>-->
        </DockPanel>
    </Grid>
</Window>
